package com.clothes.warehouse.db.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.test2.db.entity.Buy;
import com.example.test2.db.entity.Clothes;
import com.example.test2.db.entity.User;

import com.clothes.warehouse.db.gen.BuyDao;
import com.clothes.warehouse.db.gen.ClothesDao;
import com.clothes.warehouse.db.gen.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig buyDaoConfig;
    private final DaoConfig clothesDaoConfig;
    private final DaoConfig userDaoConfig;

    private final BuyDao buyDao;
    private final ClothesDao clothesDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        buyDaoConfig = daoConfigMap.get(BuyDao.class).clone();
        buyDaoConfig.initIdentityScope(type);

        clothesDaoConfig = daoConfigMap.get(ClothesDao.class).clone();
        clothesDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        buyDao = new BuyDao(buyDaoConfig, this);
        clothesDao = new ClothesDao(clothesDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Buy.class, buyDao);
        registerDao(Clothes.class, clothesDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        buyDaoConfig.clearIdentityScope();
        clothesDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public BuyDao getBuyDao() {
        return buyDao;
    }

    public ClothesDao getClothesDao() {
        return clothesDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
